package com;

import java.util.HashMap;
import java.util.Map;

import redis.clients.jedis.Jedis;

public class TestHash {
	public static void main(String[] args) {
		Jedis jedis = new Jedis("n1");
		try {
			hashTest(jedis);
		} catch (Exception e) {
			e.printStackTrace();
		} finally{
			jedis.close();
		}
	}
	private static void hashTest(Jedis jedis) {
		Map<String,String> map  = new HashMap<String, String>() {
		private static final long serialVersionUID = -2445831157173546396L; {
			put("name", "lily");
			put("gender", "0");
			put("age", "15");
		}};
		jedis.hmset("key1", map);
		String age = jedis.hget("key1", "age");
		System.out.println(age);
	}
}
